package com.huazai.out_school_manager;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import java.lang.reflect.InvocationTargetException;

public class AllTest extends HttpServlet {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
//        Class<?> c1 = Class.forName("com.huazai.out_school_manager.Dao.realization.UserDaoReal");
//        UserDaoReal dao = (UserDaoReal) c1.getDeclaredConstructor().newInstance();
//        boolean res = dao.login("2020042032","13231","admin");
//        System.out.println(res);
//        数据库登陆查询测试，成功


//        0012-12-12T20:12
//        String TestTime = "0012-12-12 20:12";
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
//        try {
//            Date submitDate = sdf.parse(TestTime);
//            System.out.println(submitDate);
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }
        AllTest allTest = new AllTest();
        allTest.testMethod();
    }

    public void testMethod() {
        ServletConfig config = this.getServletConfig();
        //获取到了ServletConfig

        ServletContext application1 = config.getServletContext();
        System.out.println("application1 = " + application1);

        ServletContext application2 = this.getServletContext();
        System.out.println("application2 = " + application2);



    }
}
//D7ePzl6R